﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;

namespace DouCat.Blog.HttpApi
{
    public class TestInterceptor : IAbpInterceptor, ITransientDependency
    {
        public Task InterceptAsync(IAbpMethodInvocation invocation)
        {
            var methodName = invocation.Method.Name;
            if (methodName == "HelloWorld")
                throw new Exception("你被拦截了，因为你没有权限！");
            invocation.ProceedAsync();
            return Task.CompletedTask;
        }
    }
}
